package com.zpark.controller;

import com.zpark.entity.User;
import com.zpark.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @PackageName: com.zpark.controller
 * @ClassName: UserController
 * @Description:
 * @author: RZS
 * @date: 2024/3/4  11:34
 */
@RestController   // 将结果以json格式数据返回   前后端分离
@RequestMapping("/user")
public class UserController {

    @Autowired
    private IUserService userService;

    @RequestMapping("/find")
    public User findByUsername(String username){
        // 调用业务层方法
        return userService.findByUsername(username);
    }
}
